Skip to content

.github: run Sonar Check only on PRs from apache/cloudstack branches#8058

Merged
shwstppr merged 1 commit intoapache:4.18from
weizhouapache:4.18-disable-sonar-if-pr-not-from-acs-branches
Oct 10, 2023
Merged

.github: run Sonar Check only on PRs from apache/cloudstack branches#8058
shwstppr merged 1 commit intoapache:4.18from
weizhouapache:4.18-disable-sonar-if-pr-not-from-acs-branches

Conversation

@weizhouapache
Copy link
Copy Markdown
Member

Description

This PR fixes #8050

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 9, 2023

Codecov Report

Merging #8058 (85dbb9f) into 4.18 (29c7b31) will increase coverage by 0.04%.
Report is 68 commits behind head on 4.18.
The diff coverage is 18.30%.

@@             Coverage Diff              @@
##               4.18    #8058      +/-   ##
============================================
+ Coverage     13.02%   13.06%   +0.04%     
- Complexity     9032     9108      +76     
============================================
  Files          2720     2720              
  Lines        257080   257537     +457     
  Branches      40088    40156      +68     
============================================
+ Hits          33476    33658     +182     
- Misses       219400   219649     +249     
- Partials       4204     4230      +26     
Files Coverage Δ
...hestration/service/VolumeOrchestrationService.java 100.00% <ø> (ø)
.../main/java/com/cloud/network/IpAddressManager.java 100.00% <100.00%> (ø)
...ava/com/cloud/network/as/AutoScaleVmProfileVO.java 80.20% <100.00%> (+11.66%) ⬆️
...java/com/cloud/upgrade/DatabaseUpgradeChecker.java 40.89% <100.00%> (+0.64%) ⬆️
...va/com/cloud/upgrade/DatabaseVersionHierarchy.java 85.10% <100.00%> (+1.01%) ⬆️
.../api/command/admin/ratelimit/ResetApiLimitCmd.java 0.00% <ø> (ø)
...oud/hypervisor/kvm/resource/LibvirtConnection.java 0.00% <ø> (ø)
.../hypervisor/kvm/storage/ScaleIOStorageAdaptor.java 10.44% <100.00%> (ø)
...ava/com/cloud/api/commands/StopNetScalerVMCmd.java 0.00% <ø> (ø)
...tungsten/api/command/ListTungstenFabricTagCmd.java 0.00% <ø> (ø)
... and 58 more

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@weizhouapache weizhouapache marked this pull request as ready for review October 9, 2023 14:21
jobs:
build:
if: github.repository == 'apache/cloudstack'
if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository
if: github.event.pull_request.head.repo.full_name == github.repository

i.e. people may run sonar on their own forks?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if so, users need to configure sonar token in github project.

For example, if someone creates a PR in shapeblue (forked) repositories, currently the sonar check is skipped.
But with this change, sonar check will not be skipped, but fail (as sonar token does not exist in project settings).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but only if they create a PR from their own repo to their own repo, so they have control on whether they create the token or not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. so between these 2 options with forks

  • enable PR sonar check by default. users need to disable it by code changes if they do not have sonar token.
  • disable PR sonar check by default. users need to enable it by code changes if they have sonar token.

the PR sonar check was disabled on forks by #7199
we can change the behaviour if needed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ps: the PR codecov check was disabled on forks by #7177

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but in both cases the code may not be merged, inconvenient :(

Copy link
Copy Markdown
Member Author

@weizhouapache weizhouapache Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right...we have to choose one of the two options.
Let's assume that most users do not have sonar token, so we run sonar check only on apache/cloudstack repository. Make sense ?

Copy link
Copy Markdown
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Copy link
Copy Markdown
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shwstppr shwstppr merged commit 864a195 into apache:4.18 Oct 10, 2023
@shwstppr shwstppr added this to the 4.18.2.0 milestone Oct 10, 2023
shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Nov 3, 2023
…pache#8058)

This PR fixes apache#8050

(cherry picked from commit 864a195)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@weizhouapache weizhouapache deleted the 4.18-disable-sonar-if-pr-not-from-acs-branches branch November 22, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants